var mongoose =require('mongoose');
var Schema = mongoose.Schema;

var OrderSchema = new Schema({
    creator: {type: Schema.Types.ObjectId, ref: 'User'},
    faction: {type: Schema.Types.ObjectId, ref: 'Faction'},
    tradeNo: {type: String},
    goodsList: [{type: Schema.Types.Mixed}],
    totalFee: {type: Number, default: 0},
    remark: {type: String, default: '正接受跪舔中~'},
    address: {type: Schema.Types.Mixed},
    payResult: {type: String},
    creatTime: {type: Date, default: Date.now},
    status: {type: String}, // waiting/pay/finish
    wxpayResult: {type: Schema.Types.Mixed}
})

mongoose.model('Order', OrderSchema);